<?php
// src/Asiah/SiklusBundle/Entity/Comment.php
namespace Asiah\SiklusBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * @ORM\Entity
 * @ORM\Table(name="comment")
 */

class Comment {

	public function __construct() {
		$this -> date(new \DateTime());
	}

	/**
	 * @ORM\Id
	 * @ORM\Column(type="integer")
	 * @ORM\GeneratedValue(strategy="AUTO")
	 */
	protected $id;
	/**
	 * @ORM\Column(type="string")
	 */
	protected $content;
	/**
	 * @ORM\Column(type="date")
	 */
	protected $date;
	/**
	 * @ORM\ManyToOne(targetEntity="Bookmark", inversedBy="comments")
	 * @ORM\JoinColumn(name="bookmark_id", referencedColumnName="id", nullable=false)
	 */
	protected $bookmark;
	/**
	 * @ORM\ManyToMany(targetEntity="User", inversedBy="comments")
	 * @ORM\JoinTable(name="usercomment")
	 */
	protected $users;
	/**
	 * Get id
	 *
	 * @return integer
	 */
	public function getId() {
		return $this -> id;
	}

	/**
	 * Set content
	 *
	 * @param string $content
	 */
	public function setContent($content) {
		$this -> content = $content;
	}

	/**
	 * Get content
	 *
	 * @return string
	 */
	public function getContent() {
		return $this -> content;
	}

	/**
	 * Set date
	 *
	 * @param date $date
	 */
	public function setDate($date) {
		$this -> date = $date;
	}

	/**
	 * Get date
	 *
	 * @return date
	 */
	public function getDate() {
		return $this -> date;
	}

	/**
	 * Set bookmark
	 *
	 * @param Asiah\SiklusBundle\Entity\Bookmark $bookmark
	 */
	public function setBookmark(\Asiah\SiklusBundle\Entity\Bookmark $bookmark) {
		$this -> bookmark = $bookmark;
	}

	/**
	 * Get bookmark
	 *
	 * @return Asiah\SiklusBundle\Entity\Bookmark
	 */
	public function getBookmark() {
		return $this -> bookmark;
	}


    /**
     * Add users
     *
     * @param Asiah\SiklusBundle\Entity\User $users
     */
    public function addUsers(\Asiah\SiklusBundle\Entity\User $users)
    {
        $this->users[] = $users;
    }

    /**
     * Get users
     *
     * @return Doctrine\Common\Collections\Collection 
     */
    public function getUsers()
    {
        return $this->users;
    }

    /**
     * Add users
     *
     * @param Asiah\SiklusBundle\Entity\User $users
     */
    public function addUser(\Asiah\SiklusBundle\Entity\User $users)
    {
        $this->users[] = $users;
    }
}